#include <bits/stdc++.h>
using namespace std;
inline int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') {
            f = -1;
        }
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0', ch = getchar();
    }
    return x * f;
}
const int MAXN = 100005;
int n;
int a[MAXN], b[MAXN] = {0}, s[MAXN] = {0};
int main() {
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	n = read();
	int maxa = 0;
	for (int i = 0; i < n; i++) {
		a[i] = read();
		b[a[i]]++;
	}
	for (int i = 1; i <= MAXN; i++) {
        s[i] = s[i - 1] + b[i];
	}
	int ans = n, ans2 = 0, total = 0;
	for (int i = 2; i <= MAXN; i++) {
        s[i] -= total;
        ans2 = min(s[i - 1], b[i]);
        ans -= ans2;
        s[i] -= ans2;
        total += ans2;
        ans2 = 0;
	}
	cout << ans << endl;
	return 0;
}
